/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "ECRITUREC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ecriturec.findAll", query = "SELECT e FROM Ecriturec e"),
    @NamedQuery(name = "Ecriturec.findByIdEc", query = "SELECT e FROM Ecriturec e WHERE e.idEc = :idEc"),
    @NamedQuery(name = "Ecriturec.findByJour", query = "SELECT e FROM Ecriturec e WHERE e.jour = :jour"),
    @NamedQuery(name = "Ecriturec.findByDateec", query = "SELECT e FROM Ecriturec e WHERE e.dateec = :dateec"),
    @NamedQuery(name = "Ecriturec.findByPiece", query = "SELECT e FROM Ecriturec e WHERE e.piece = :piece"),
    @NamedQuery(name = "Ecriturec.findByNumFact", query = "SELECT e FROM Ecriturec e WHERE e.numFact = :numFact"),
    @NamedQuery(name = "Ecriturec.findByRefFact", query = "SELECT e FROM Ecriturec e WHERE e.refFact = :refFact"),
    @NamedQuery(name = "Ecriturec.findByLibelleec", query = "SELECT e FROM Ecriturec e WHERE e.libelleec = :libelleec"),
    @NamedQuery(name = "Ecriturec.findBySens", query = "SELECT e FROM Ecriturec e WHERE e.sens = :sens"),
    @NamedQuery(name = "Ecriturec.findByMontant", query = "SELECT e FROM Ecriturec e WHERE e.montant = :montant"),
    @NamedQuery(name = "Ecriturec.findByNumcg", query = "SELECT e FROM Ecriturec e WHERE e.numcg = :numcg"),
    @NamedQuery(name = "Ecriturec.findByNumcgContr", query = "SELECT e FROM Ecriturec e WHERE e.numcgContr = :numcgContr"),
    @NamedQuery(name = "Ecriturec.findByNumct", query = "SELECT e FROM Ecriturec e WHERE e.numct = :numct"),
    @NamedQuery(name = "Ecriturec.findByNumctcontr", query = "SELECT e FROM Ecriturec e WHERE e.numctcontr = :numctcontr"),
    @NamedQuery(name = "Ecriturec.findByDateecheance", query = "SELECT e FROM Ecriturec e WHERE e.dateecheance = :dateecheance"),
    @NamedQuery(name = "Ecriturec.findByDatesaisie", query = "SELECT e FROM Ecriturec e WHERE e.datesaisie = :datesaisie"),
    @NamedQuery(name = "Ecriturec.findByLigneec", query = "SELECT e FROM Ecriturec e WHERE e.ligneec = :ligneec"),
    @NamedQuery(name = "Ecriturec.findByNumlettrage", query = "SELECT e FROM Ecriturec e WHERE e.numlettrage = :numlettrage"),
    @NamedQuery(name = "Ecriturec.findByLettrage", query = "SELECT e FROM Ecriturec e WHERE e.lettrage = :lettrage"),
    @NamedQuery(name = "Ecriturec.findByNumpointage", query = "SELECT e FROM Ecriturec e WHERE e.numpointage = :numpointage"),
    @NamedQuery(name = "Ecriturec.findByPointage", query = "SELECT e FROM Ecriturec e WHERE e.pointage = :pointage")})
public class Ecriturec implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_EC")
    private Integer idEc;
    @Column(name = "JOUR")
    private Short jour;
    @Column(name = "DATEEC")
    @Temporal(TemporalType.DATE)
    private Date dateec;
    @Column(name = "PIECE")
    private Integer piece;
    @Column(name = "NUM_FACT")
    private String numFact;
    @Column(name = "REF_FACT")
    private String refFact;
    @Column(name = "LIBELLEEC")
    private String libelleec;
    @Column(name = "SENS")
    private Short sens;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "MONTANT")
    private BigDecimal montant;
    @Column(name = "NUMCG")
    private String numcg;
    @Column(name = "NUMCG_CONTR")
    private String numcgContr;
    @Column(name = "NUMCT")
    private String numct;
    @Column(name = "NUMCTCONTR")
    private String numctcontr;
    @Column(name = "DATEECHEANCE")
    @Temporal(TemporalType.DATE)
    private Date dateecheance;
    @Column(name = "DATESAISIE")
    @Temporal(TemporalType.DATE)
    private Date datesaisie;
    @Column(name = "LIGNEEC")
    private Integer ligneec;
    @Column(name = "NUMLETTRAGE")
    private Integer numlettrage;
    @Column(name = "LETTRAGE")
    private Integer lettrage;
    @Column(name = "NUMPOINTAGE")
    private Integer numpointage;
    @Column(name = "POINTAGE")
    private Integer pointage;
    @JoinColumns({
        @JoinColumn(name = "NUMEXO", referencedColumnName = "NUMEXO"),
        @JoinColumn(name = "MOIS", referencedColumnName = "MOIS")})
    @ManyToOne(optional = false)
    private Periode periode;
    @JoinColumn(name = "NUMJO", referencedColumnName = "NUMJO")
    @ManyToOne(optional = false)
    private Journaux numjo;
    @JoinColumn(name = "ID_JOP", referencedColumnName = "ID_JOP")
    @ManyToOne
    private Joperiode idJop;
    @JoinColumn(name = "ID_CT", referencedColumnName = "ID_CT")
    @ManyToOne
    private Comptet idCt;
    @JoinColumn(name = "ID_CG", referencedColumnName = "ID_CG")
    @ManyToOne(optional = false)
    private Compteg idCg;

    public Ecriturec() {
    }

    public Ecriturec(Integer idEc) {
        this.idEc = idEc;
    }

    public Integer getIdEc() {
        return idEc;
    }

    public void setIdEc(Integer idEc) {
        this.idEc = idEc;
    }

    public Short getJour() {
        return jour;
    }

    public void setJour(Short jour) {
        this.jour = jour;
    }

    public Date getDateec() {
        return dateec;
    }

    public void setDateec(Date dateec) {
        this.dateec = dateec;
    }

    public Integer getPiece() {
        return piece;
    }

    public void setPiece(Integer piece) {
        this.piece = piece;
    }

    public String getNumFact() {
        return numFact;
    }

    public void setNumFact(String numFact) {
        this.numFact = numFact;
    }

    public String getRefFact() {
        return refFact;
    }

    public void setRefFact(String refFact) {
        this.refFact = refFact;
    }

    public String getLibelleec() {
        return libelleec;
    }

    public void setLibelleec(String libelleec) {
        this.libelleec = libelleec;
    }

    public Short getSens() {
        return sens;
    }

    public void setSens(Short sens) {
        this.sens = sens;
    }

    public BigDecimal getMontant() {
        return montant;
    }

    public void setMontant(BigDecimal montant) {
        this.montant = montant;
    }

    public String getNumcg() {
        return numcg;
    }

    public void setNumcg(String numcg) {
        this.numcg = numcg;
    }

    public String getNumcgContr() {
        return numcgContr;
    }

    public void setNumcgContr(String numcgContr) {
        this.numcgContr = numcgContr;
    }

    public String getNumct() {
        return numct;
    }

    public void setNumct(String numct) {
        this.numct = numct;
    }

    public String getNumctcontr() {
        return numctcontr;
    }

    public void setNumctcontr(String numctcontr) {
        this.numctcontr = numctcontr;
    }

    public Date getDateecheance() {
        return dateecheance;
    }

    public void setDateecheance(Date dateecheance) {
        this.dateecheance = dateecheance;
    }

    public Date getDatesaisie() {
        return datesaisie;
    }

    public void setDatesaisie(Date datesaisie) {
        this.datesaisie = datesaisie;
    }

    public Integer getLigneec() {
        return ligneec;
    }

    public void setLigneec(Integer ligneec) {
        this.ligneec = ligneec;
    }

    public Integer getNumlettrage() {
        return numlettrage;
    }

    public void setNumlettrage(Integer numlettrage) {
        this.numlettrage = numlettrage;
    }

    public Integer getLettrage() {
        return lettrage;
    }

    public void setLettrage(Integer lettrage) {
        this.lettrage = lettrage;
    }

    public Integer getNumpointage() {
        return numpointage;
    }

    public void setNumpointage(Integer numpointage) {
        this.numpointage = numpointage;
    }

    public Integer getPointage() {
        return pointage;
    }

    public void setPointage(Integer pointage) {
        this.pointage = pointage;
    }

    public Periode getPeriode() {
        return periode;
    }

    public void setPeriode(Periode periode) {
        this.periode = periode;
    }

    public Journaux getNumjo() {
        return numjo;
    }

    public void setNumjo(Journaux numjo) {
        this.numjo = numjo;
    }

    public Joperiode getIdJop() {
        return idJop;
    }

    public void setIdJop(Joperiode idJop) {
        this.idJop = idJop;
    }

    public Comptet getIdCt() {
        return idCt;
    }

    public void setIdCt(Comptet idCt) {
        this.idCt = idCt;
    }

    public Compteg getIdCg() {
        return idCg;
    }

    public void setIdCg(Compteg idCg) {
        this.idCg = idCg;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEc != null ? idEc.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ecriturec)) {
            return false;
        }
        Ecriturec other = (Ecriturec) object;
        if ((this.idEc == null && other.idEc != null) || (this.idEc != null && !this.idEc.equals(other.idEc))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Ecriturec[ idEc=" + idEc + " ]";
    }
    
}
